package com.shiliao.app.utils;

import android.webkit.WebChromeClient;
import android.webkit.WebSettings;

import com.shiliao.app.weight.ProgressWebView;

/**
 * Created by yinzhiqiang on 2017/10/19.
 */

public class WebSetUtil {
    public static final void setWebView(ProgressWebView webview) {
        webview.setInitialScale(28);
        WebSettings settings = webview.getSettings();
        settings.setUseWideViewPort(true);
        settings.setLoadWithOverviewMode(true);
        settings.setTextSize(WebSettings.TextSize.NORMAL);
        settings.setJavaScriptEnabled(true);
        settings.setJavaScriptCanOpenWindowsAutomatically(true);
        settings.setAllowFileAccess(true);// 设置允许访问文件数据
        // settings.setSupportZoom(true);
        //settings.setBuiltInZoomControls(true);
        settings.setJavaScriptCanOpenWindowsAutomatically(true);
        settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
        settings.setDomStorageEnabled(true);
        settings.setDatabaseEnabled(true);
        webview.setWebChromeClient(new WebChromeClient());
    }
}
